﻿/*****************************************
 * 
 *  copyright (c) by ylshen
 * 
 *  author : ylshen (syl.lucky@gmail.com)
 *  
 **************************************** */

using System;
using System.Collections.Generic;
using System.Text;

namespace JYStockAnalyser.Model
{
    /// <summary>
    /// 指标类型
    /// </summary>
    [Serializable]
    public class GuideLineType
    {     
        int m_no;
        string m_name;
        string m_unit;
        bool m_isImportant;

   
        /// <summary>
        /// 指标编号
        /// </summary>
        public int NO
        {
            get { return m_no; }
            set { m_no = value; }
        }
        /// <summary>
        /// 指标名称
        /// </summary>
        public string Name
        {
            get { return m_name; }
            set { m_name = value; }
        }
        /// <summary>
        /// 单位
        /// </summary>
        public string Unit
        {
            get { return m_unit; }
            set { m_unit = value; }
        }
        /// <summary>
        /// 是否为重要指标
        /// </summary>
        public bool IsImportant
        {
            get { return m_isImportant; }
            set { m_isImportant = value; }
        }

        public override string ToString()
        {
            return Name;
        }

        /// <summary>
        /// 获取指标全称（带单位）
        /// </summary>
        /// <returns></returns>
        public string GetFullName()
        {
            return string.Format("{0}({1})", Name, Unit);
        }

        public override bool Equals(object obj)
        {
            if (obj == null) { return false; }
            if (obj.GetType() != this.GetType()) { return false; }
            GuideLineType type = (GuideLineType)obj;
            return type.NO.Equals(this.NO);
        }

        public override int GetHashCode()
        {
            return this.NO.GetHashCode();
        }
    }
}
